home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: Greatest Hits 1996
/
Amiga Games: Greatest Hits 1996.iso
/
archive
/
userbox
/
publicdomain
/
fractal.lha
/
fractal
/
source_original
/
USAGE
< prev
Wrap
Text File
|
1996-07-02
|
2KB
|
84 lines
This is a very brief note on usage of enc.c and dec.c and on raw image
files.
FILE TYPE:
First, the input file to enc must be raw bytes which are not
references into a color lookup table. The image size must
be a multiple of 4. A typical calling sequence for a 256x256 image is:
enc -t 10 infile.raw outfile.trn
THE TOLERANCE FLAG:
A range of 4-20 is reasonable for the -t flag, with small values
giving good fidelity at poor compression and vice versa.
INPUT IMAGE SIZE:
The -M flag controls the size of the smallest image pieces that are
compared for self similarity. The following table gives the value
that should be used:
Smallest Input Image Dimension -M value
--------------------------------------------------------
128 5
256 6 (default)
512 7
etc.
Using too large a -M will cause the program to warn you that it
doesn't make sense to do that (the resulting compression will
be poor); using too small a -M flag will cause the resulting fidelity
to be poor (often, but not always).
For (say) 512x512 images the calling sequence is:
enc -t 10 -M 7 -w 512 infile.raw outfile.trn
The -M flags should probably be automatic; oh well.
DECODING:
The decoding call is:
dec outfile.trn outfile.out
which creates a raw byte image outfile.out.
The outputfile can be scaled with the -f flag.
dec -f 2 outfile.trn outfile.out
will result in an outputfile that is twice as big as the
input.
VIEWING THE IMAGE:
The file Images/r2s.c will create sunraster header. It can be prepended
to the raw data files to convert them to sunraster format. To use
r2s.c, compile it (cc -o r2s.c r2s), and then type
r2s 256 256 > head
cat head imagefile.raw > imagefile.ras
which will create a head file for a 256x256 sunraster file and prepend
it to the raw image file....
All of this should be automated; maybe it will be some day....
CREATING RAW FILES:
ras2raw.c is a C program to convert just some types of sunraster images
(no run length encoding, sorry) to raw byte files. It is in the Images
directory with the raw images.
-----
Good luck; thanks for your interest.
Yuval Fisher
yfisher@ucsd.edu